package com.hmdp.utils;

/**
 * ClassName: ILock
 * Package: com.hmdp.utils
 *
 * @Author: itheima-ht
 * @Create: 2025/4/11 20:17
 */
public interface ILock {

    /**
     * 尝试获取锁
     *
     * @param timeoutSec 锁的超时时间
     * @return true代表获取锁成功，false代表获取锁失败
     */
    boolean tryLock(long timeoutSec);

    /**
     * 释放锁
     */
    void unLock();
}
